import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import login from "../views/login/login";
import home from "../views/layout";
import index from '../views/index';
import user from "../views/user/user";
import not from '../views/404'
import bumen from "../views/bumen/bumen";
import company from "../views/company/company";
import position from "../views/position/position";
import customer from "../views/customer/customer";
import returnvisit from "../views/returnvisit/returnvisit";
const router = new VueRouter({
  mode:"history",
  routes:[{
    path:'/',
    component:login,
    name:'login'
  },{
    path:'/home',
    component:home,
    name:'home',
    redirect:"/home/index",
    children:[{
      path:'/home/index',
      component:index,
      name:'index',
      meta:{
        title:"统计管理",
        icon:"pie-chart"
      }
    },{
      path:'/home/company',
      component:company,
      name:'company',
      meta:{
        title:"公司管理",
        icon:"office-building"
      }
    },{
      path:'/home/bumen',
      component:bumen,
      name:'bumen',
      meta:{
        title:"部门管理",
        icon:"notebook-2"
      }
    },{
      path:'/home/position',
      component:position,
      name:'position',
      meta:{
        title:"职位管理",
        icon:"mouse"
      }
    },{
      path:'/home/user',
      component:user,
      name:'user',
      meta:{
        title:"员工管理",
        icon:"user"
      }
    },{
      path:'/home/customer',
      component:customer,
      name:'customer',
      meta:{
        title:"客户管理",
        icon:"document-copy"
      }
    },{
      path:'/home/returnvisit',
      component:returnvisit,
      name:'returnvisit',
      meta:{
        title:"回访管理",
        icon:"chat-line-round"
      }
    },{
      path:'/home/usercenter',
      component:()=>import('../views/userCenter'),
      name:'userCenter',
      meta:{
        title:"个人中心",
        icon:"setting"
      }
    }]
  },{
    path:'/404',
    component:not
  },
    {
    path:'*',
    redirect:'/404'
  }]
})


export default router
